package com.demo;

public class Method2Demo {
    public static void main(String[] args) {

        System.out.println(sum(20,30));

        System.out.println(sum(20,30.20));

        System.out.println(sum(30,40,20));
    }

    /**
     * 方法重载
     * @param a
     * @param b
     * @return
     */
    public static int sum(int a,int b){
        return a+b;
    }

    public static double sum(int a, double b){
        return a+b;
    }

    public static int sum(int a,int b,int c){
        return a+b+c;
    }
}
